package com.zhiche.lisa.bms.service.activiti;

import com.zhiche.lisa.bms.pojo.vo.activiti.HistoryTask;
import org.activiti.engine.task.Task;

import java.util.List;
import java.util.Map;

/**
 * @author linbao
 * @date 2018-10-16
 */
public interface ActivitiCommonService {

    /**
     * 启动流程, 根据指定名
     *
     * @param workFlowName
     * @return
     * @throws Exception
     */
    String startWorkFlowCommon(String workFlowName) throws Exception;

    /**
     * 报价单启动流程
     *
     * @param type
     * @return
     * @throws Exception
     */
    String startWorkFlow(String type) throws Exception;

    /**
     * 启动支付申请单审核
     *
     * @return
     * @throws Exception
     */
    String startPayApplyWorkFlow(Map<String, Object> map) throws Exception;

    /**
     * 启动临时报价单审批流程
     *
     * @return
     * @throws Exception
     */
    String startTempQuoteWorkFlow() throws Exception;

    /**
     * 获取当前任务
     *
     * @param processId
     * @return
     * @throws Exception
     */
    Task getCurrentTaskByProcessId(String processId) throws Exception;

    /**
     * 根据id获取流程
     *
     * @param taskId
     * @return
     * @throws Exception
     */
    Task getTaskByTaskId(String taskId) throws Exception;

    /**
     * 获取任务
     *
     * @param assignee
     * @return
     * @throws Exception
     */
    List<Task> getTaskList(String assignee) throws Exception;

    /**
     * 查询当前待审核的id
     *
     * @param assignee
     * @return
     * @throws Exception
     */
    List<String> getCurrntUserTaskId(String assignee) throws Exception;

    /**
     * 完成
     *
     * @param taskId
     * @param map
     * @throws Exception
     */
    void taskComplete(String taskId, Map<String, Object> map) throws Exception;

    /**
     * 完成
     *
     * @param taskId
     * @throws Exception
     */
    void taskComplete(String taskId) throws Exception;

    /**
     * 查询审批历史
     *
     * @param pid
     * @return
     * @throws Exception
     */
    List<HistoryTask> queryActivitiHistoryTaskList(String pid) throws Exception;

    /**
     * 删除任务
     *
     * @param pid
     * @param reason
     * @throws Exception
     */
    void deleteActivitiByProcessId(String pid, String reason) throws Exception;
}
